export const importConfig = {
	tabSteps: [
		{
			label: '下载模板',
			download: '下载模板',
			active: 1,
			rules: [
				{
					label: '下载最新导入模板。共1个：',
					children: [
						{
							label: '《活动记录模板》',
							link: true,
							url: 'view_dpOrgActivityRecord_downloadTemplate',
						},
					],
				},
			],
		},
		{
			label: '导入信息',
			description: '',
			uploadTip: '活动记录',
			active: 2,
			url: 'view_dpOrgActivityRecord_import',
			code: 3031,
			rules: [
				{
					label: '导入规则说明:',
					children: [
						{
							label: '(1)导入模式为“覆盖导入”，待导入的信息会覆盖平台已存在的',
						},
					],
				},
			],
		},
	],
	dataType: 90,
}

export const formConfig = {
	inline: false,
	showBtn: true,
	labelPosition: 'left',
	column: [
		{
			label: '机构统一社会信用代码',
			prop: 'creditCode',
			maxlength: '18',
			showWordLimit: true,
			type: 'text',
			span: 8,
			labelPosition: 'top',
			rules: [{ required: true, message: '请输入统一社会信用代码' }],
		},
		{
			label: '服务组织机构名称',
			prop: 'organizationName',
			maxlength: '50',
			showWordLimit: true,
			type: 'text',
			labelPosition: 'top',
			span: 8,
			rules: [{ required: true, message: '请输入服务组织机构名称' }],
		},
		{
			label: '活动类型',
			prop: 'activityType',
			propName: 'activityTypeLabel',
			type: 'remoteSelect',
			code: 'ACTIVITY_TYPE',
			api: 'getDictItemList',
			dataType: 'number',
			filterKey: 'value',
			multiple: false,
			labelPosition: 'top',
			span: 8,
			rules: [{ required: true, message: '请选择活动类型' }],
		},

		{
			label: '活动名称',
			prop: 'activityName',
			maxlength: '140',
			showWordLimit: true,
			type: 'textarea',
			labelPosition: 'top',
			autosize: {
				minRows: 1,
			},
			span: 8,
		},
		{
			label: '活动日期',
			prop: 'activityTime',
			type: 'datetime',
			format: 'YYYY年MM月DD HH:mm:ss',
			valueFormat: 'YYYY-MM-DD HH:mm:ss',
			changeField: false,
			labelPosition: 'top',
			span: 8,
			rules: [{ required: true, message: '请选择活动日期' }],
		},
		{
			label: '活动地点',
			prop: 'activityAddress',
			maxlength: '50',
			showWordLimit: true,
			type: 'text',
			labelPosition: 'top',
			span: 8,
			rules: [{ required: true, message: '请输入活动地点' }],
		},
		{
			label: '活动内容',
			prop: 'activityContent',
			maxlength: '1000',
			showWordLimit: true,
			type: 'textarea',
			labelPosition: 'top',
			span: 24,
			rules: [{ required: true, message: '请输入活动内容' }],
		},
		{
			label: '活动照片',
			tip: '',
			prop: 'activityImgs',
			type: 'upload',
			listType: 'picture-card',
			labelPosition: 'top',
			showFileList: true,
			limit: 10,
			multiple: false,
			span: 16,
		},
		{
			label: '签到记录',
			tip: '',
			prop: 'signRecordImgs',
			type: 'upload',
			labelPosition: 'top',
			showFileList: false,
			limit: 10,
			multiple: false,
			span: 8,
		},
		{
			label: '组织人',
			prop: 'activitySponsor',
			maxlength: '20',
			showWordLimit: true,
			type: 'text',
			labelPosition: 'top',
			span: 8,
		},
		{
			label: '参与部门',
			prop: 'activityParticipants',
			maxlength: '500',
			showWordLimit: true,
			type: 'text',
			labelPosition: 'top',
			span: 8,
		},
		{
			label: '参与人数',
			prop: 'participantsNumber',
			isNum: true,
			type: 'input',
			labelPosition: 'top',
			span: 8,
		},
		{
			label: '参加部门及人员',
			prop: 'activityParticipants',
			type: 'input',
			span: 8,
		},
		{
			label: '活动创建人',
			prop: 'activityAddUser',
			type: 'input',
			span: 8,
		},
		{
			label: '活动创建时间',
			prop: 'activityAddTime',
			type: 'input',
			span: 8,
		},
		{
			label: '参加部门',
			prop: 'participatingDepartments',
			type: 'input',
			span: 8,
		},
		{
			label: '备注',
			prop: 'activityNote',
			maxlength: '140',
			showWordLimit: true,
			type: 'textarea',
			labelPosition: 'top',
			span: 24,
		},
	],
}

export const searchConfig = {
	inline: true,
	showBtn: true,
	labelPosition: 'left',
	column: [
		{
			label: '机构统一社会信用代码',
			prop: 'creditCode',
			maxlength: '18',
			showWordLimit: true,
			type: 'text',
			span: 8,
		},
		{
			label: '服务组织机构名称',
			prop: 'organizationName',
			type: 'text',
			span: 8,
		},
		{
			label: '活动类型',
			prop: 'activityType',
			propName: 'activityTypeLabel',
			type: 'remoteSelect',
			code: 'ACTIVITY_TYPE',
			api: 'getDictItemList',
			dataType: 'number',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},

		{
			label: '活动名称',
			prop: 'activityName',
			type: 'input',
			span: 8,
		},
		{
			label: '活动地点',
			prop: 'activityAddress',
			type: 'text',
			span: 8,
		},
		{
			label: '活动时间',
			prop: 'activityTimeBetween',
			type: 'dateBetween',
			span: 8,
		},
	],
}

export const tableConfig = {
	stripe: true,
	border: true,
	columns: [
		// { label: '机构统一社会信用代码', prop: 'creditCode' },
		{ label: '服务组织机构', prop: 'organizationName' },
		{ label: '活动名称', prop: 'activityName' },
		{ label: '活动日期', prop: 'activityTime' },
		{ label: '活动地点', prop: 'activityAddress' },
		{ label: '参与人数', prop: 'participantsNumber' },
		{
			label: '是否可信',
			prop: 'isBelievable',
			custome: 'tag',
			dicData: [
				{ label: '否', value: 0, type: 'danger' },
				{ label: '是', value: 1, type: 'success' },
			],
		},
		{
			label: '操作',
			prop: 'menu',
			width: 300,
			fixed: 'right',
		},
	],
}

export const api = {
	index: 'view_dpOrgActivityRecord_page',
	add: 'view_dpOrgActivityRecord_add',
	edit: 'view_dpOrgActivityRecord_edit',
	delete: 'view_dpOrgActivityRecord_del',
	export: 'view_dpOrgActivityRecord_export',
	import: 'view_dpOrgActivityRecord_import',
}
export const baseConfig = {
	pageName: '活动记录',
	dictcodes: ['ACTIVITY_TYPE', 'DANGER_LEVEL'],
	rowKey: 'id',
	addLabel: '新增',
	tipLabel: 'organizationName',
	exportMqTopic: '/ning/export/',
	paramsObj: {
		code: 3031,
	},
	api,
	auth: {
		index: 'view_dpOrgActivityRecord_page',
		// add: 'view_dpOrgActivityRecord_add',
		// edit: 'view_dpOrgActivityRecord_edit',
		delete: 'view_dpOrgActivityRecord_del',
		// export: 'view_dpOrgActivityRecord_export',
		// import: 'view_dpOrgActivityRecord_import',
		mulitSet: 'mulitSet',
	},
	menuBtn: [
		// {
		// 	icon: 'editor',
		// 	label: '编辑',
		// 	type: 'primary',
		// 	operate: 'edit',
		// 	auth: 'view_dpDangerAssess_edit',
		// 	text: true,
		// 	show: true,
		// },
		{
			icon: 'detail',
			label: '查看详情',
			type: 'primary',
			operate: 'detail',
			auth: 'view_dpDangerAssess_page',
			text: true,
			show: true,
		},
		// {
		// 	icon: 'delete',
		// 	label: '删除',
		// 	type: 'danger',
		// 	operate: 'delete',
		// 	auth: 'view_dpDangerAssess_del',
		// 	text: true,
		// 	show: true,
		// },
	],

	saveFormate: async (form) => {
		return new Promise((resolve, reject) => {
			resolve(form)
		})
	},
	dialogConfig: {
		width: '75%',
	},
	searchConfig,
	formConfig,
	tableConfig,
	importConfig,
	detailConfig: formConfig,
}
